package time;

import java.util.Calendar;
import java.util.Date;

public class Calender1 {
    public static void main(String[] args) {
        // 获得系统此时此刻的日历对象1
        Calendar now = Calendar.getInstance();

        // 获取日历中的某个信息
        int year = now.get(Calendar.YEAR);
        System.out.println(year);

        int days = now.get(Calendar.DAY_OF_YEAR);
        System.out.println(days);

        // 拿到日历记录的日期对象
        Date d = now.getTime();
        System.out.println(d);

        // 修改日历的某个信息
        now.set(Calendar.MONTH, 9);// 修改为9月份
        now.set(Calendar.DAY_OF_YEAR, 125);// 修改为一年中的第125天
        System.out.println(now);

        Test3 t = new Test3();
    }
}
